package com.cy.pj.category.controller;

import com.cy.pj.category.pojo.Category;
import com.cy.pj.category.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author 张琪
 */
@Controller
public class CategoryController {

    @Autowired
    private CategoryService categoryService;


    @ResponseBody
    @GetMapping("/category/findCategory")
    public List<Category> doFindCategory() {
        List<Category> list = categoryService.findCategory(null);
        return list;
    }

}
